#ifndef SWSERVERWIDGET_H
# define SWSERVERWIDGET_H

# include <QTcpServer>
# include <QTcpSocket>

# include "swcommonwidget.h"

class SWServerWidget : public SWCommonWidget
{
    Q_OBJECT

public:
    SWServerWidget(int);
    ~SWServerWidget();
    bool isListening() { return m_server->isListening(); }

private:
    QTcpServer *m_server;
    QTcpSocket *m_client;

    void connectSignals();
    void createServer(int);

private slots:
    void readyRead();
    void clientDisconnected();
    void newConnection();
    void sendData();
};

#endif

